package allwe.thread03;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class Test {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        //定义一个线程对象
        TestRandom testRandom = new TestRandom();
        FutureTask futureTask = new FutureTask(testRandom);
        Thread thread = new Thread(futureTask);
        thread.start();
        //获取子线程的返回值
        Object object = futureTask.get();
        System.out.println(object);
    }
}
